#ifndef QTEST_TIME_SERIES_H_
#define QTEST_TIME_SERIES_H_

/**
 * @file QTest_TimeSeries.h
 */

#include <QtGui/QApplication>
#include <QtCore/QObject>
#include <QtTest/QtTest>

#include "TimeSeries.h"

#include "widgets/plotting/ScatterPlot.h"
#include <qwt_plot.h>

#include <QtCore/QVector>
#include <vector>

using namespace std;
using namespace spectClean;

class QTest_TimeSeries : public QObject
{
    private:
        Q_OBJECT

    public:
        QTest_TimeSeries() {}
        ~QTest_TimeSeries() {}

    private slots:
        void test()
        {
            typedef SpectrumComponent fc;
            TimeSeries t;
            vector<fc> components;
            components.push_back(fc(1.0, 2.0));

            const unsigned num_times = 100;
            const double start_time = 0.0;
            const double end_time = 1.0;
            t.generateEven(num_times, start_time, end_time, components);


            _p.push_back(new QwtPlot);
            QwtPlot * p = _p.back();
            p->setMinimumSize(500, 500);
            p->setVisible(true);

            _s.push_back(new ScatterPlot);
            _s.back()->setTitle("Even");
            _s.back()->setData(t.size(), &t.amp()[0]);
            _s.back()->attach(p);
            p->setTitle(_s.back()->title());



        }

    private:
        QVector<QwtPlot*> _p;
        QVector<ScatterPlot*> _s;
};


int main(int argc, char ** argv)
{
    QApplication app(argc, argv);
    QTest_TimeSeries t;
    QTest::qExec(&t, argc, argv);
    return app.exec();
}



#endif // QTEST_TIME_SERIES_H_
